Embodiments of the present invention may generally relate to application debugging. More particularly, embodiments relate to tracking specific Java native interface (JNI) invocations of system and library calls.
Software applications such as Java applications may execute in the context of a Java virtual machine (JVM), which can offer the ability to execute both Java methods and invoke native methods (e.g., C/C++ methods) using JNI. There may be numerous issues experienced at the JNI layer that necessitate contextual tracing for optimal results. For instance, if a JNI method invokes a native method that in turn invokes a system or library call, when the system/library call fails a relatively large amount of debugging instrumentation may be required to understand which parameters were passed to the system/library call and why it failed. Indeed, existing tracing techniques may trace all invocation sequences of the native method in such a case, which can lead to the generation of unnecessary trace data, adverse performance impacts at runtime, and timing difficulties that may even prevent the problem from being recreated. These challenges may be particularly pronounced in the context of complex enterprise applications and production environments.